﻿using BLL.AntiFake;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace NbSecurityAppManage.Origins
{
    public partial class Index : System.Web.UI.Page
    {
        DigitCodeBLL digitCodeBLL = new DigitCodeBLL();
        protected void Page_Load(object sender, EventArgs e)
        {
           
            string sycode = string.Empty;//溯源编号
            if(!IsPostBack){
                sycode = Request.QueryString["sycode"];//溯源码
                string fwPart = sycode.Substring(0, 6);
                //查询产品批次信息
                if (digitCodeBLL.TabExists(fwPart))
                {
                    DataTable tbl = digitCodeBLL.GetModelByWlCode(fwPart,sycode);
                    if(tbl!=null&&tbl.Rows.Count>0){//非空集合
                        Response.Redirect("http://t.m12315.com//MaterialPreview/Index?batchId=" + tbl.Rows[0]["ProductBatchId"] + "&sycode=" + sycode);
                    }
                    }
                }

                 
        }
    }
}